package com.molin.threadTest.myThreadTest;

public class Demo2 {
    public static void main(String[] args) {
        //获取main方法的线程对象
       Thread thread= Thread.currentThread();
        String name = thread.getName();
        System.out.println(name);
    }
}
